<% if @login_user.is_vip==NO %>
	<% form_for :user, :html => { :multipart => true } do |f| %>
		<%= image_tag(@login_user.avatar.url, :class => "headphoto")%>
		<p>上传将覆盖原来的图片</p>
		<div class="form_text"><label class="label" for="avatar">上传图片</label><span class="required_mark">*</span></div>
		<%= f.file_field :avatar%>
		<%= error_message_on @login_user, :avatar_file_name -%>
		<%= error_message_on @login_user, :avatar_size -%>
		<%= error_message_on @login_user, :avatar_content_type%>
		<%= text_field_for f,:name, @login_user,{:text=>"您的姓名", :required=>true}%>
		<%= text_field_for f,:company, @login_user,{:text=>"公司名称", :required=>true}%>
		<%= text_field_for f,:email, @login_user,{:text=>"电子邮件", :required=>true}%>
		<%= submit_tag "修改", :class => "btn" %>
	<% end %>
	<p>您还不是创意宝会员，升级为<%=link_to "创意宝",:controller => "admin/profile", :action => "vip_register" %>会员，享受更多优惠</p>
<% else %>
	<% form_for :profile do |f| %>
		<%= text_field_for f, :name, @profile, { :text => "您的姓名", :required => true } %>
		<%= text_field_for f, :department, @profile, { :text => "您的部门" } %>
		<%= text_field_for f, :company, @profile, { :text=>"公司名称", :required => true } %>
		<div class="required">
			<div class="form_text">
				<label for="address" class="label">公司所在地</label>
				<span class="required_mark">*</span>
			</div>
			<div>
				<span>
				<%= f.collection_select :pid, Province.all,:provinceid,:province, 
										{ :prompt => "请选择" },
										{ :onchange => "#{
															remote_function( :url => {:controller =>'admin/profile', :action => "gain_cities"}, 
																			 :with => "'province_id='+value",
																			 :complete => "$('#area').hide()",
																			 :update => 'city')
														  }"}%>
				</span>										  
				<span id="city"></span>	
				<span id="area"></span>
				<%= error_div(@profile,:pid,"公司所在地")%>		
			</div>											  
		</div>
		<%= text_field_for f, :com_full_address, @profile,{ :text => "公司详细地址", :required => true } %>
		<%= text_field_for f, :zip_code, @profile, { :text => "邮政编码", :required => true } %>
		<%= text_field_for f, :tel, @profile, { :text => "固定电话", :required => true } %>
		<%= text_field_for f, :mobile, @profile, { :text => "移动电话", :required => true } %>
		<%= text_field_for f, :fax, @profile, { :text => "传真" } %>
		<%= text_field_for f, :email, @profile, { :text => "公司邮箱" } %>
		<%= text_field_for f, :qq, @profile, { :text => "QQ" } %>
		<div class="submit">
			<%= submit_tag "修改", :class => "btn"%>
		</div>	
	<% end %>
<% end %>